// PluginSetupApp.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <malloc.h>

#include "..\PluginSetup\PluginDecl.h"

void WaitForKey()
{
	while(!_kbhit());
}

void LogWrite(LPSTR lpstrMessage)
{
	printf("\r\n");
	printf(lpstrMessage);
}

void AppMessageFunction(PluginData* pData)
{
	LogWrite("Message received by app.");
}

int _tmain(int argc, _TCHAR* argv[])
{
	// version 5.1
	LogWrite("PluginSetup \"Mercury\" (C) Dacris Software.");
	LogWrite("About to start...");
	// create PluginApplication
	PluginData *app = (PluginData*)malloc(sizeof(PluginData));
	app->pValue = (void*)&AppMessageFunction;
	app->iValue = 1;
	AppAttach(app);
	LogWrite("PluginSetup Started. Press a key to exit.");
	WaitForKey();
	AppDetach(app);
	free(app);
	return 0;
}